package p1;

public class Student {
    private String name;
    private int age;

    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name = name;
    }
    public int getAge(){
        return this.age;
    }
    public void setAge(int age){
        if(age < 18 || age > 30){
            System.out.println("年龄超过范围，不允许修改");
            return;
        }
        this.age = age;
    }

  
}
